package com.lemonPiggy.UDForm.service.impl;

import java.util.Date;
import java.util.List;

import com.lemonPiggy.UDForm.domain.UDFormAuthorize;
import com.lemonPiggy.UDForm.mapper.UDFormAuthorizeMapper;
import com.lemonPiggy.UDForm.service.IUDFormAuthorizeService;
import com.ruoyi.common.core.utils.IdUtils;
import com.ruoyi.common.core.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 页面权限Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-08-02
 */
@Service
public class UDFormAuthorizeServiceImpl implements IUDFormAuthorizeService
{
    @Autowired(required=false)
    private UDFormAuthorizeMapper UDFormAuthorizeMapper;

    /**
     * 查询页面权限
     * 
     * @param id 页面权限ID
     * @return 页面权限
     */
    @Override
    public UDFormAuthorize selectUDFormAuthorizeById(String id)
    {
        return UDFormAuthorizeMapper.selectUDFormAuthorizeById(id);
    }

    /**
     * 查询页面权限列表
     * 
     * @param UDFormAuthorize 页面权限
     * @return 页面权限
     */
    @Override
    public List<UDFormAuthorize> selectUDFormAuthorizeList(UDFormAuthorize UDFormAuthorize)
    {
        return UDFormAuthorizeMapper.selectUDFormAuthorizeList(UDFormAuthorize);
    }

    /**
     * 新增页面权限
     * 
     * @param UDFormAuthorize 页面权限
     * @return 结果
     */
    @Override
    public int insertUDFormAuthorize(UDFormAuthorize UDFormAuthorize)
    {
        String uuid = IdUtils.simpleUUID();
        UDFormAuthorize.setId(uuid);
        UDFormAuthorize.setCreatedBy(SecurityUtils.getUsername());
        UDFormAuthorize.setUpdatedBy(SecurityUtils.getUsername());
        UDFormAuthorize.setCreatedTime(new Date());
        UDFormAuthorize.setUpdatedTime(new Date());
        return UDFormAuthorizeMapper.insertUDFormAuthorize(UDFormAuthorize);
    }

    /**
     * 修改页面权限
     * 
     * @param UDFormAuthorize 页面权限
     * @return 结果
     */
    @Override
    public int updateUDFormAuthorize(UDFormAuthorize UDFormAuthorize)
    {
        return UDFormAuthorizeMapper.updateUDFormAuthorize(UDFormAuthorize);
    }

    /**
     * 批量删除页面权限
     * 
     * @param ids 需要删除的页面权限ID
     * @return 结果
     */
    @Override
    public int deleteUDFormAuthorizeByIds(String[] ids)
    {
        return UDFormAuthorizeMapper.deleteUDFormAuthorizeByIds(ids);
    }

    /**
     * 删除页面权限信息
     * 
     * @param id 页面权限ID
     * @return 结果
     */
    @Override
    public int deleteUDFormAuthorizeById(String id)
    {
        return UDFormAuthorizeMapper.deleteUDFormAuthorizeById(id);
    }



    @Override
    public List<UDFormAuthorize> selectTypeId(String id) {
        return UDFormAuthorizeMapper.selectTypeId(id);
    }
}
